home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_FILEPAT.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
1KB
|
50 lines
FUNCTION _FilePath
PARAMETER pc_fname
*--------------------------------------------------------------------
* NAME
* _FILEPATH - Returns path portion of a complete filespec.
*
* SYNOPSIS
* _FILEPATH( pc_fname )
*
* DESCRIPTION
* _FILEPATH() returns the path from the full
* description of the file specified by pc_fname.
* The drive letter, if any, is not returned.
*
* If the filespec does not contain a path, the
* null string ("") is returned.
*
* PARAMETER
* pc_fname - A character full DOS filespec.
*
* EXAMPLE
* lc_fpath = _FilePath( "C:\TEST\FOO.PRG" )
* ( lc_fpath will equal "\TEST\" )
*
* lc_fpath = _FilePath( "MYFILE.TXT" )
* ( lc_fpath will equal "" )
*
* SEE ALSO
* _FILEDRV(), _FILEROOT(), _FILETYPE()
*
*--------------------------------------------------------------------
PRIVATE ln_pathpos, lc_slash
IF LEFT( OS(), 3 ) = "DOS"
lc_slash = "\"
ELSE
lc_slash = "/"
ENDIF
ln_pathpos = AT( lc_slash, pc_fname )
RETURN( IIF( ln_pathpos > 0, ;
SUBSTR( pc_fname, ln_pathpos, ;
RAT(lc_slash,pc_fname)-ln_pathpos+1 ),;
"" ) )
*-- EOF: _FilePath( pc_fname )